package com.cty.pojo;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;


/**
 * @Auther: cty
 * @Date: 2020/4/1 11:54
 * @Description: Menu实体类
 * @version: 1.0
 */
public class Menu {
    private int id;
    @JsonProperty(value="text")
    private String name;
    private int pid;
    private List<Menu> children;
    private boolean checked;


    // 当仅添加一个自定义属性时
//    @JsonProperty(value = "attributes")
//    private String filename;

    // 当添加多个自定义属性时
    private String filename;
    private Attributes attributes;

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public Attributes getAttributes() {
        return attributes;
    }

    public void setAttributes(Attributes attributes) {
        this.attributes = attributes;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public List<Menu> getChildren() {
        return children;
    }

    public void setChildren(List<Menu> children) {
        this.children = children;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    @Override
    public String toString() {
        return "Menu{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", pid=" + pid +
                ", children=" + children +
                ", checked=" + checked +
                ", filename='" + filename + '\'' +
                ", attributes=" + attributes +
                '}';
    }
}
